package com.lotter.controller;

import java.util.HashMap;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;


import com.lotter.service.LotterOrderService;

/**
 * 彩票订单
 * 
 * @author panguixiang
 *
 */
@Controller
@RequestMapping("/lotterorder")
public class LotterOrderController {

	private static Logger logger = Logger.getLogger(LotterOrderController.class);

	@Autowired
	private LotterOrderService lotterOrderService;

	@RequestMapping(value = "page", method = RequestMethod.GET)
	public String fiancepage() {
		return "lotter/orderlist";
	}
	/**
	 * 彩票订单列表
	 * @param startdatestr
	 * @param enddatestr
	 * @param mobile
	 * @param page
	 * @param rows
	 * @return
	 */
	@ResponseBody
	@RequestMapping("pagelist")
	public Map<String, Object> pageList(
			@RequestParam(value = "startdatestr", required = false) String startdatestr,
			@RequestParam(value = "enddatestr", required = false) String enddatestr,
			@RequestParam(value = "mobile", required = false) String mobile,
			@RequestParam(value = "page", required = false) Integer page,
			@RequestParam(value = "rows", required = false) Integer rows) {
		Map<String, Object> result = new HashMap<String, Object>();
		try {
			lotterOrderService.getLotterOrderPage(startdatestr, enddatestr,mobile, page, rows, result);
		} catch (Exception e) {
			logger.error(e);
			e.printStackTrace();
		}
		return result;
	}

}
